Pull request: Closes #465 Move site management code to its own module

#465