Template synthesis of polyaniline and poly(2-methoxyaniline) nanotubes: comparison of the formation mechanisms